﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SharingCenter.Web.Admin.Posts
{
    using SharingCenter.Web.Classes;
    public partial class Settings : System.Web.UI.Page
    {

        protected void Page_Init(object sender, EventArgs e)
        {
            ShowCongifValues();
            btnSubmit.Click += new EventHandler(btnSubmit_Click);
        }

        void btnSubmit_Click(object sender, EventArgs e)
        {
            SiteConfig.WriteSetting(SiteConfigSection.Post, "HotThreadByReadCount", txtHotThreadByReadCount.Text);
            SiteConfig.WriteSetting(SiteConfigSection.Post, "HotThreadByReplyCount", txtHotThreadByReplyCount.Text);
            SiteConfig.SubmitChanges();
        }

        void ShowCongifValues()
        {
            txtHotThreadByReadCount.Text = SiteConfig.ReadSetting(SiteConfigSection.Post, "HotThreadByReadCount");
            txtHotThreadByReplyCount.Text = SiteConfig.ReadSetting(SiteConfigSection.Post, "HotThreadByReplyCount");
        }

        
    }
}
